package com.hisoft.controller;

import com.hisoft.pojo.User;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

/**
 * @program: swagger2demo
 * @description:
 * @author: wlg
 * @create: 2021-11-15 15:09:43
 **/
@Api(tags = {"用户管理"},description = "包括用户注册，登录，添加，修改，删除等功能")
@RequestMapping("/user")
@RestController
public class SwaggerController {
    @ApiOperation(value = "查看某用户具体信息")
    @ApiImplicitParams(
            @ApiImplicitParam(name = "id",value = "用户的唯一标识",required = true,paramType = "query")
    )
    @RequestMapping(value = "/userInfo", method = RequestMethod.GET)
    public Object getUserById(@RequestParam Integer id){
        User user = new User(1,"张三");
        return user;
    }

    @ApiOperation(value = "保存用户")
    @RequestMapping(value = "/save", method = RequestMethod.POST)
    public Object save(@RequestBody User user){
        return user;
    }
}

